/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.persistencia.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;

/**
 *
 * @author kenny
 */
@Entity
@Table(name = "periodo")
@NamedQueries({
    @NamedQuery(name = "Periodo.findAll", query = "SELECT p FROM Periodo p"),
    @NamedQuery(name = "Periodo.findByNPrdId", query = "SELECT p FROM Periodo p WHERE p.nPrdId = :nPrdId"),
    @NamedQuery(name = "Periodo.findByNDia", query = "SELECT p FROM Periodo p WHERE p.nDia = :nDia"),
    @NamedQuery(name = "Periodo.findByDtHora", query = "SELECT p FROM Periodo p WHERE p.dtHora = :dtHora"),
    @NamedQuery(name = "Periodo.findByVEstado", query = "SELECT p FROM Periodo p WHERE p.vEstado = :vEstado")})
public class Periodo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "nPrdId")
    private Integer nPrdId;
    @Basic(optional = false)
    @Column(name = "nDia")
    private int nDia;
    @Column(name = "dtHora")
    @Temporal(TemporalType.TIME)
    private Date dtHora;
    @Column(name = "vEstado")
    private String vEstado;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "nPrdId")
    private List<Periodoxsalon> periodoxsalonList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "periodo")
    private List<Docentexperiodo> docentexperiodoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "periodo")
    private List<Asignaturaxperiodo> asignaturaxperiodoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "periodo")
    private List<Salonxperiodo> salonxperiodoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "periodo")
    private List<Clasexperiodo> clasexperiodoList;

    public Periodo() {
    }

    public Periodo(Integer nPrdId) {
        this.nPrdId = nPrdId;
    }

    public Periodo(Integer nPrdId, int nDia) {
        this.nPrdId = nPrdId;
        this.nDia = nDia;
    }

    public Integer getNPrdId() {
        return nPrdId;
    }

    public void setNPrdId(Integer nPrdId) {
        this.nPrdId = nPrdId;
    }

    public int getNDia() {
        return nDia;
    }

    public void setNDia(int nDia) {
        this.nDia = nDia;
    }

    public Date getDtHora() {
        return dtHora;
    }

    public void setDtHora(Date dtHora) {
        this.dtHora = dtHora;
    }

    public String getVEstado() {
        return vEstado;
    }

    public void setVEstado(String vEstado) {
        this.vEstado = vEstado;
    }

    public List<Periodoxsalon> getPeriodoxsalonList() {
        return periodoxsalonList;
    }

    public void setPeriodoxsalonList(List<Periodoxsalon> periodoxsalonList) {
        this.periodoxsalonList = periodoxsalonList;
    }

    public List<Docentexperiodo> getDocentexperiodoList() {
        return docentexperiodoList;
    }

    public void setDocentexperiodoList(List<Docentexperiodo> docentexperiodoList) {
        this.docentexperiodoList = docentexperiodoList;
    }
    
    public List<Asignaturaxperiodo> getAsignaturaxperiodoList() {
        return asignaturaxperiodoList;
    }

    public void setAsignaturaxperiodoList(List<Asignaturaxperiodo> asignaturaxperiodoList) {
        this.asignaturaxperiodoList = asignaturaxperiodoList;
    }
    
    public List<Salonxperiodo> getSalonxperiodoList() {
        return salonxperiodoList;
    }

    public void setSalonxperiodoList(List<Salonxperiodo> salonxperiodoList) {
        this.salonxperiodoList = salonxperiodoList;
    }
    
    public List<Clasexperiodo> getClasexperiodoList() {
        return clasexperiodoList;
    }

    public void setClasexperiodoList(List<Clasexperiodo> clasexperiodoList) {
        this.clasexperiodoList = clasexperiodoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nPrdId != null ? nPrdId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Periodo)) {
            return false;
        }
        Periodo other = (Periodo) object;
        if ((this.nPrdId == null && other.nPrdId != null) || (this.nPrdId != null && !this.nPrdId.equals(other.nPrdId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.persistencia.domain.Periodo[ nPrdId=" + nPrdId + " ]";
    }
    
}
